package string;

public class StringDemo2 {
    public static void main(String[] args){
        String str = "a";
        StringBuilder sb = new StringBuilder("a");
        for (int i = 0; i < 1000000; i++) {
            sb.append("a");
        }
        System.out.println("拼接完毕1" + sb.length());
        for(int i = 0; i < 1000000; i++){
            str = str + "a";//s = new StringBuilder(s).append("a").toString();
        }
        System.out.println("拼接完毕2");
    }
}
